var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    content_info: '',
    top_title: ''
  },
  
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this;
    app.ihttpGet('https://www.58zltc.com/api.php/Quan/member/openid/' + options.openid + '/mopenid/' + app.globalData.openid, function (res) {
      that.setData({
        info: res.data
      })
    });
    if (options.type == 'visit') { //访问记录
      app.ihttpGet('https://www.58zltc.com/api.php/Quan/getVisitLog/openid/' + options.openid + '/type/' + options.type, function (res) {
        that.setData({
          list: res.data
        })
      });
      that.setData({
        content_info: '访问过你',
        top_title: '访问记录'
      })
    } else if (options.type == 'follow') { //关注记录
      app.ihttpGet('https://www.58zltc.com/api.php/Quan/getFollowLog/openid/' + options.openid, function (res) {
        that.setData({
          list: res.data
        })
      });
      that.setData({
        content_info: '关注了你',
        top_title: '关注记录'
      })
    } else if (options.type == 'anlian') { //暗恋记录
      app.ihttpGet('https://www.58zltc.com/api.php/Quan/getAnlianLog/openid/' + options.openid, function (res) {
        that.setData({
          list: res.data
        })
      });
      that.setData({
        content_info: '暗恋了你',
        top_title: '暗恋记录'
      })
    } else if (options.type == 'gift') { //送礼记录
      app.ihttpGet('https://www.58zltc.com/api.php/Quan/getGiftLog/openid/' + options.openid, function (res) {
        that.setData({
          list: res.data
        })
      });
      that.setData({
        content_info: '给你送过礼物',
        top_title: '送礼记录'
      })
    }
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  backto: function (e) {
    wx.navigateBack({
      
    })
  },
  goMember: function (e) {
    var openid = e.currentTarget.dataset.openid;
    var url = '/pages/quan/member/member?openid=' + openid;
    wx.navigateTo({
      url: url,
    })
  }
})